package demo;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public class DateTimeUtil {
	/**
	 * yyyy-MM-dd HH:mm:ss.sss
	 */
	public static String format2Y4_M_dTHms$S3(DateTime dateTime){
		return dateTime.toString("yyyy-MM-dd HH:mm:ss.SSS");
	}
	
	public static DateTime parse2DateTime(String dateStr){
		DateTimeFormatter formatter = DateTimeFormat .forPattern("yyyy-MM-dd HH:mm:ss.SSS");
		return DateTime.parse(dateStr, formatter);
	}
}
